home *** CD-ROM | disk | FTP | other *** search
Java Source | 2004-04-28 | 468 b | 23 lines |
- public class Prova {
- private static class Job extends AbstractJob {
- private int i;
- public Job(int j) {
- i = j;
- }
- public void execute() {
- System.out.println(i);
- }
- }
- public static void main(String[] args) {
- BackgroundJobExecutor ex = new BackgroundJobExecutor();
- ex.add(new Job(0));
- ex.add(new Job(3));
- ex.add(new Job(4));
- ex.add(new Job(8));
- ex.add(new Job(12));
- ex.add(new Job(9));
- ex.start();
- ex.stop();
- }
- }
-